package com.bfly.mall.advert.enums;

/**
 * 优惠卷使用范围
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/20 22:50
 */
public enum CouponUseRange {
    ALL(0, "全场通用卷"),
    CATEGORY(1, "指定类目卷"),
    PRODUCT(2, "指定产品卷");

    CouponUseRange(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static CouponUseRange getRange(int id) {
        for (CouponUseRange status : CouponUseRange.values()) {
            if (status.getId() == id) {
                return status;
            }
        }
        return null;
    }

    private int id;

    private String name;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
}
